﻿<%@ Page Language="C#" MasterPageFile="~/admin/Admin.master" AutoEventWireup="true"
    CodeFile="ViewOrderDetails.aspx.cs" Inherits="admin_ViewOrderDetails" Title="Untitled Page" %>

<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">
    <title>View Details Order</title>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolderContent" runat="Server">
    <asp:GridView ID="GridViewOrderItem" runat="server" AutoGenerateColumns="False" 
        DataSourceID="ObjectDataSource1" Width="750px" AllowPaging="True">
        <Columns>
            <asp:TemplateField HeaderText="ID product">
                <ItemTemplate>
                <a target="_blank" href="../user/productDetails.aspx?ID=<%#Eval("pd_id") %>">
                <%#Eval("pd_id") %></a>
                </ItemTemplate>
            </asp:TemplateField>
            <asp:BoundField DataField="odi_quantity" HeaderText="Quantity" 
                SortExpression="odi_quantity" />
            <asp:BoundField DataField="odi_price" HeaderText="Price" 
                SortExpression="odi_price" />
        </Columns>
    </asp:GridView>
    <asp:ObjectDataSource ID="ObjectDataSource1" runat="server" 
        InsertMethod="Insert" OldValuesParameterFormatString="original_{0}" 
        SelectMethod="GetDataBy" 
        TypeName="DataSet2TableAdapters.tbl_order_itemTableAdapter">
        <SelectParameters>
            <asp:QueryStringParameter Name="od_id" QueryStringField="ID" Type="Int32" />
        </SelectParameters>
        <InsertParameters>
            <asp:Parameter Name="od_id" Type="Int32" />
            <asp:Parameter Name="pd_id" Type="Int32" />
            <asp:Parameter Name="odi_quantity" Type="Int32" />
            <asp:Parameter Name="odi_price" Type="Decimal" />
        </InsertParameters>
    </asp:ObjectDataSource>
    <br />
    <asp:DetailsView ID="DetailsViewOrder" runat="server" Height="50px" Width="750px"
        AutoGenerateRows="False" DataKeyNames="od_id" AutoGenerateEditButton="True" OnModeChanging="DetailsViewOrder_ModeChanging"
        OnItemUpdating="DetailsViewOrder_ItemUpdating" DefaultMode="Edit">
        <Fields>
            <asp:BoundField DataField="od_id" HeaderText="Order ID" ReadOnly="True" SortExpression="od_id" />
            <asp:TemplateField HeaderText="Order Code">
                <ItemTemplate>
                    <%#Eval("od_code")%>
                </ItemTemplate>
                <EditItemTemplate>
                    <asp:TextBox ID="TextBoxCode" runat="server" Text='<%#Eval("od_code")%>'></asp:TextBox>
                </EditItemTemplate>
            </asp:TemplateField>
            <asp:BoundField DataField="cus_id" HeaderText="Customer ID" SortExpression="cus_id"
                ReadOnly="True" />
                        <asp:TemplateField HeaderText="Order Date">
                <ItemTemplate>
                    <%#Eval("od_date")%>
                </ItemTemplate>
                <EditItemTemplate>
                    <asp:TextBox ID="TextBoxDate" runat="server" Text='<%#Eval("od_date")%>'></asp:TextBox>
                </EditItemTemplate>
            </asp:TemplateField>
            <asp:TemplateField HeaderText="Status" SortExpression="od_status">
                <ItemTemplate>
                    <%#Eval("od_status")%>
                </ItemTemplate>
                <EditItemTemplate>
                    <asp:DropDownList ID="DropDownListStatus" runat="server">
                        <asp:ListItem>Waiting</asp:ListItem>
                        <asp:ListItem>Approved</asp:ListItem>
                    </asp:DropDownList>
                </EditItemTemplate>
            </asp:TemplateField>
            <asp:TemplateField HeaderText="Shipping First name">
                <ItemTemplate>
                    <%#Eval("od_shipping_firstname")%>
                </ItemTemplate>
                <EditItemTemplate>
                    <asp:TextBox ID="TextBoxSFname" runat="server" Text='<%#Eval("od_shipping_firstname")%>'></asp:TextBox>
                </EditItemTemplate>
            </asp:TemplateField>
            <asp:TemplateField HeaderText="Shipping Last name">
                <ItemTemplate>
                    <%#Eval("od_shipping_lastname")%>
                </ItemTemplate>
                <EditItemTemplate>
                    <asp:TextBox ID="TextBoxSLname" runat="server" Text='<%#Eval("od_shipping_lastname")%>'></asp:TextBox>
                </EditItemTemplate>
            </asp:TemplateField>
            <asp:TemplateField HeaderText="Shipping email">
                <ItemTemplate>
                    <%#Eval("od_shipping_email")%>
                </ItemTemplate>
                <EditItemTemplate>
                    <asp:TextBox ID="TextBoxSemail" runat="server" Text='<%#Eval("od_shipping_email")%>'></asp:TextBox>
                </EditItemTemplate>
            </asp:TemplateField>
            <asp:TemplateField HeaderText="Shipping Address">
                <ItemTemplate>
                    <%#Eval("od_shipping_address")%>
                </ItemTemplate>
                <EditItemTemplate>
                    <asp:TextBox ID="TextBoxSAddress" runat="server" Text='<%#Eval("od_shipping_address")%>'></asp:TextBox>
                </EditItemTemplate>
            </asp:TemplateField>
            <asp:TemplateField HeaderText="Shipping Phone">
                <ItemTemplate>
                    <%#Eval("od_shipping_phone")%>
                </ItemTemplate>
                <EditItemTemplate>
                    <asp:TextBox ID="TextBoxSphone" runat="server" Text='<%#Eval("od_shipping_phone")%>'></asp:TextBox>
                </EditItemTemplate>
            </asp:TemplateField>
            <asp:TemplateField HeaderText="Shipping state">
                <ItemTemplate>
                    <%#Eval("od_shipping_state")%>
                </ItemTemplate>
                <EditItemTemplate>
                    <asp:TextBox ID="TextBoxSState" runat="server" Text='<%#Eval("od_shipping_state")%>'></asp:TextBox>
                </EditItemTemplate>
            </asp:TemplateField>
            <asp:TemplateField HeaderText="Shipping city">
                <ItemTemplate>
                    <%#Eval("od_shipping_city")%>
                </ItemTemplate>
                <EditItemTemplate>
                    <asp:TextBox ID="TextBoxScity" runat="server" Text='<%#Eval("od_shipping_city")%>'></asp:TextBox>
                </EditItemTemplate>
            </asp:TemplateField>
            <asp:TemplateField HeaderText="Shipping zipcode">
                <ItemTemplate>
                    <%#Eval("od_shipping_zipcode")%>
                </ItemTemplate>
                <EditItemTemplate>
                    <asp:TextBox ID="TextBoxSzipcode" runat="server" Text='<%#Eval("od_shipping_zipcode")%>'></asp:TextBox>
                </EditItemTemplate>
            </asp:TemplateField>
            <asp:TemplateField HeaderText="Payment name">
                <ItemTemplate>
                    <%#Eval("od_payment_name")%>
                </ItemTemplate>
                <EditItemTemplate>
                    <asp:TextBox ID="TextBoxPMname" runat="server" Text='<%#Eval("od_payment_name")%>'></asp:TextBox>
                </EditItemTemplate>
            </asp:TemplateField>
            <asp:TemplateField HeaderText="Payment cardtype">
                <ItemTemplate>
                    <%#Eval("od_payment_cardtype")%>
                </ItemTemplate>
                <EditItemTemplate>
                    <asp:DropDownList ID="PayDropDownListCard" runat="server" Width="150">
                        <asp:ListItem>Visa</asp:ListItem>
                        <asp:ListItem>Master Card</asp:ListItem>
                    </asp:DropDownList>
                </EditItemTemplate>
            </asp:TemplateField>
            <asp:TemplateField HeaderText="Payment card num">
                <ItemTemplate>
                    <%#Eval("od_payment_cardnum")%>
                </ItemTemplate>
                <EditItemTemplate>
                    <asp:TextBox ID="TextBoxPMcardnum" runat="server" Text='<%#Eval("od_payment_cardnum")%>'></asp:TextBox>
                </EditItemTemplate>
            </asp:TemplateField>
            <asp:TemplateField HeaderText="Payment verinum">
                <ItemTemplate>
                    <%#Eval("od_payment_verinum")%>
                </ItemTemplate>
                <EditItemTemplate>
                    <asp:TextBox ID="TextBoxPMverinum" runat="server" Text='<%#Eval("od_payment_verinum")%>'></asp:TextBox>
                </EditItemTemplate>
            </asp:TemplateField>
            <asp:TemplateField HeaderText="Payment expdate">
                <ItemTemplate>
                    <%#Eval("od_payment_expridate")%>
                </ItemTemplate>
                <EditItemTemplate>
                    <asp:TextBox ID="TextBoxPMexpri" runat="server" Text='<%#Eval("od_payment_expridate")%>'></asp:TextBox>
                </EditItemTemplate>
            </asp:TemplateField>
            <asp:TemplateField HeaderText="Order quantity">
                <ItemTemplate>
                    <%#Eval("od_quantity")%>
                </ItemTemplate>
                <EditItemTemplate>
                    <asp:TextBox ID="TextBoxquantity" runat="server" Text='<%#Eval("od_quantity")%>'></asp:TextBox>
                </EditItemTemplate>
            </asp:TemplateField>
            <asp:TemplateField HeaderText="Total price">
                <ItemTemplate>
                    <%#Eval("od_totalprice")%>
                </ItemTemplate>
                <EditItemTemplate>
                    <asp:TextBox ID="Texttotalprice" runat="server" Text='<%#Eval("od_totalprice")%>'></asp:TextBox>
                </EditItemTemplate>
            </asp:TemplateField>
        </Fields>
    </asp:DetailsView>
</asp:Content>
